package com.aimi.servlet;

import com.aimi.entity.Admin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @PostMapping("/login")
    public String handleLogin(@RequestBody Admin admin){
        System.out.println("登录页面");
        System.out.println("账号：" + admin.getUsername());
        System.out.println("密码：" + admin.getPassword());
        if(admin.getUsername().equals("张二狗") && admin.getPassword().equals("zrq123456")){
            return "/users/showusers.html";
        }
        return "/index.html";
    }
}
